﻿using System;
using System.Linq;
using System.Xml.Linq;
using Common.Constants;
using Common.Helper;
using Common.Interface;
using MainProcessor.Processors;
using NUnit.Framework;

namespace Test.Main.Processors
{
    [TestFixture]
    public class ReportingFilterProcessorTests
    {
        private IReportingFilter reportingFilter;

        [SetUp]
        public void SetUp()
        {
            reportingFilter = new ReportingFilterProcessor();
        }

        [Test]
        public void ShouldReturntheLatestAumMeasureTermObject()
        {
            var xml = XElement.Parse(ConstantXml.TestString);

            var element = (from parentContainer in xml.Descendants(XmlConstants.ParentContainer)
                           select parentContainer).FirstOrDefault();


            reportingFilter.Initialise(element, XmlConstants.ReportingFilter, XmlConstants.FilterType);
            Assert.IsFalse(reportingFilter.MacShowReferenceFundNameinMacReporting);
            Assert.AreEqual(2, reportingFilter.MacPortfolioRiskDataWhenAggregated);
            Assert.AreEqual(0, reportingFilter.MacData);
            Assert.AreEqual(0, reportingFilter.ReportingData_3);
            Assert.AreEqual(2, reportingFilter.MacPortfolioRiskData);
            Assert.AreEqual(0, reportingFilter.MacPositionLevelData);
            


        }
    }
}

